package com.guoyh.billocal.boxmanger

import com.guoyh.baseutils.mylog.Loger
import com.guoyh.billocal.ObjectBox
import com.guoyh.billocal.entity.wmodel.ArticleBeanLocal

/**
 * @CreateDate: 2021/8/20 10:51 上午
 * @Author: guoyh
 * @Description: java类作用描述
 */
object ArticleBox {

    val box = ObjectBox.boxFor(ArticleBeanLocal::class.java)

    fun addArticle(articleBeanLocal: ArticleBeanLocal) {
        Loger.dd("addArticle : ${Thread.currentThread().name}", box)
        box.put(articleBeanLocal)
    }

    fun addArticle2(articleBeanLocal: ArticleBeanLocal) {
        Loger.dd("addArticle : ${Thread.currentThread().name}", box)
        box.put(articleBeanLocal)
    }

    fun addArticle(articleBeans: Collection<ArticleBeanLocal>) {
        Loger.dd("addArticle : ${Thread.currentThread().name}", box)
        box.put(articleBeans)
    }

    fun query() = box.query().build().find()

}

